/* See LICENSE file for copyright and license details. */

/* appearance */
static const int newclientathead    = 0;        /* 定义新窗口在栈顶还是栈底  0 栈底 1 栈顶*/
static const unsigned int borderpx  = 3;        /* border pixel of windows  窗口边框大小 */
static const unsigned int snap      = 32;       /* snap pixel   边缘依附宽度 */
static const int rmaster            = 0;        /* 1 means master-area is initially on the right */
static const unsigned int gappih    = 10;       /* horiz inner gap between windows */
static const unsigned int gappiv    = 10;       /* vert inner gap between windows */
static const unsigned int gappoh    = 10;       /* horiz outer gap between windows and screen edge */
static const unsigned int gappov    = 10;       /* vert outer gap between windows and screen edge */
static const int smartgaps          = 0;        /* 1 means no outer gap when there is only one window */
static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayonleft = 0;   	/* 0: systray in the right corner, >0: systray on left of status text */
static const unsigned int systrayspacing = 2;   /* systray spacing */
static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
static const int showsystray        = 1;     /* 0 means no systray 是否显示状态栏托盘*/
static const int showbar            = 1;     /* 0 means no bar     是否显示状态栏 */
static const int topbar             = 1;     /* 0 means bottom bar 指定状态栏位置 0底部 1顶部*/
static const int vertpad            = 10;    /* vertical padding of bar 状态栏监视器边缘间隔 */
static const int sidepad            = 10;    /* horizontal padding of bar 状态栏监视器边缘间隔 */
static const int showalltags        = 0;     /* 0 means no show all tags     是否显示所有tag标签 */
static const char buttonbar[]       = "";   /* 按钮图标 <O> 「零」       ﭾ */
static const int showwintitlebutton = 1;     /* 0 means no winbarbutton   是否显示窗口状态栏按钮 关闭、隐藏/显示、浮动、置顶 */
static const char wintitlebutton[]  = "";   /* 按钮图标 x  x   ﰸ ﳠ ﮤ ﯇                    車                      烙 落*/
static const char tab_btn_prev[]    = "";   /* ﲕ ﲖ ﲑ ﲒ     ↔ ↕ ← ↑↓ →   ⏻  ⏼            */
static const char tab_btn_next[]    = "";   /*      ﮖ */
static const char tab_btn_close[]   = "";   /*                     烙 落  */
static const int tabbuttonpad       = 10;    /* tab 三个按钮间隔 */  
static const int tabvertpad         = 10;    /* tabbar horizontal padding for statusbar Tab状态栏垂直间距 */
static const int tabsidepad         = 10;    /* tabbar vertical padding for statusbar   Tab状态栏水平间距 */
static const Bool viewontag         = True;  /* Switch view on tag switch  切换当前窗口到其他tag 时跟随*/
static const char key_mode_icon_insert[]   = "";   /*                */
static const char key_mode_icon_cmd[]      = "";   /*                                */
#define ICONSIZE 16   /* icon size */
#define ICONSPACING 5 /* space between icon and title */
/*   Display modes of the tab bar: never shown, always shown, shown only in */
/*   monocle mode in presence of several windows.                           */
/*   Modes after showtab_nmodes are disabled                                */
static const int showtab            = showtab_auto; /* Default tab bar show mode */
static const Bool toptab            = True;    /* False means bottom tab bar */
static const int overviewgappi      = 18;        /* overview时 窗口与边缘 缝隙大小 */
static const int overviewgappo      = 36;        /* overview时 窗口与窗口 缝隙大小 */
static const char *overviewtag      = "OVERVIEW";
static const Layout overviewlayout  = { "﬛",  overview }; /* ﬛  ﯎ */
static const char *fonts[]          = {         /* 字体 */
    "JetBrainsMono Nerd Font:style=medium:size=10", 
    "monospace:size=10" 
}; 
static const char dmenufont[]       = "JetBrainsMono Nerd Font:style=medium:size=13";      /* dmenu字体 */
static const char col_gray1[]       = "#222222";
static const char col_gray2[]       = "#444444";
static const char col_gray3[]       = "#bbbbbb";
static const char col_gray4[]       = "#eeeeee";
static const char col_cyan[]        = "#005577";
static const char col_urgborder[]   = "#ff0000";  /* 紧急窗口边框颜色 */
static const unsigned int baralpha  = 0xd0;
static const unsigned int borderalpha = OPAQUE;
// theme
// #include "themes/catppuccin.h"
// #include "themes/dracula.h"
// #include "themes/gruvchad.h"
// #include "themes/nord.h"
#include "themes/onedark.h"
static const char *colors[][3]      = {
	/*                        fg         bg         border   */
	/*                        字体       背景        边框     */
	[SchemeNorm]          = { col_gray3, col_gray1, col_gray2 },
	[SchemeSel]           = { col_gray4, col_cyan,  col_cyan  },
	[SchemeHid]           = { col_cyan,  col_gray1, col_cyan  },
	// [WinTitleButtonNorm]  = { col_cyan,  col_gray1, col_cyan  },
	[SchemeUrg]           = { col_gray4, col_cyan,  col_urgborder  },
    [TabSel]              = { col_gray4, col_cyan,  col_cyan  },
    [TabNorm]             = { col_gray3, col_gray1, col_gray2 },
    [SchemeBtnPrev]       = { green,   black,  black },
    [SchemeBtnNext]       = { yellow,  black,  black },
    [SchemeBtnClose]      = { red,     black,  black },
};
static const unsigned int alphas[][3]      = {
	/*                        fg      bg        border     */
	/*                        字体    背景       边框       */
	[SchemeNorm]          = { OPAQUE, baralpha, borderalpha },
	[SchemeSel]           = { OPAQUE, baralpha, borderalpha },
	[SchemeHid]           = { OPAQUE, baralpha, borderalpha },
	// [WinTitleButtonNorm]  = { OPAQUE, baralpha, borderalpha },
    [TabSel]        = { OPAQUE, baralpha, borderalpha },
    [TabNorm]       = { OPAQUE, baralpha, borderalpha },
    [SchemeBtnPrev] = { OPAQUE, baralpha, borderalpha },
    [SchemeBtnNext] = { OPAQUE, baralpha, borderalpha },
    [SchemeBtnClose]= { OPAQUE, baralpha, borderalpha },
};

/* tagging  标记*/
/* 自定义特定实例的显示状态 */
//           
//            ﮸ 
//            ﮸  
//           
//           
// static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
// static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "", "", "ﬄ", "﬐", "" };
// static const char *tags[] = { "一", "二", "三", "四", "五", "六", "七", "八", "九" ,"", "", "ﬄ", "﬐", ""}
// static const char *tags[] = { "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" ,"", "", "ﬄ", "﬐", ""}
// static const char *tags[] = { "", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "", "", "", "", "", "", "" };
// static const char *tags[] = { "", "", "", "", "", "", "", "", "", "", "", "ﬄ", "﬐", "" };
// static const char *tags[] = { "", "", "", "", "", "", "", "", "", "", "", "ﬄ", "﬐", "" };
static const char *tags[] = { "", "", "", "", "", "", "", "", "" };

/* default layout per tags */
/* The first element is for all-tag view, following i-th element corresponds to */
/* tags[i]. Layout is referred using the layouts array index.*/
static int def_layouts[1 + LENGTH(tags)]  = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

/* include(s) defining functions */
#include "keymodes.pre.h"

/* 窗口规则 */
static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 */
	/* class      instance    title       tags mask     isfloating   monitor */
	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
};
// 获取应用窗口的class名的方法 ： 使用在终端输入命令： xprop  会出现 鼠标变为+，移动鼠标光标到应用窗口区域，单击，终端处会输出窗口信息，里面有WM_CLASS的值
// tags mask 标签掩码 标记“1”是000000001，而标记9是100000000。标记“3”是000000100（从右起第三个）
// 1 << 8，表示1向左移动八个位置生成掩码100000000，选择标记数组中的标记“9”（从右起第九个）。

/* layout(s)   布局 */
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster     = 1;    /* number of clients in master area */
static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
static const int decorhints  = 1;    /* 1 means respect decoration hints */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */

// ﬿ 﩯         ﬘ ﬛  ﯅  難   𧻓 ﮋ ﮑ ﴟ
// 舘 𤋮 恵 ﵁     𧻓 ﯎ 侀 
//   ﳶ
static const Layout layouts[] = {
	/* symbol      arrange function */
	/* 象征，标志  排列函数 */
	// { "[]=",      tile },    /* first entry is default 第一次进入默认布局： 平铺主次栈布局 */
	{ "﬿",      tile },    /* first entry is default 第一次进入默认布局： 平铺主次栈布局 */
	// { "[D]",    deck },    /*  */
	{ "",    deck },    /*  */
	// { "[M]",      monocle }, /* 单片眼镜 */
	{ "﬘",      monocle }, /* 单片眼镜 ﯎ ﬘  */
	{ "﩯",      grid}, /* 网格布局 */
	// { "><>",      NULL },    /* no layout function means floating behavior 无布局，即浮动*/
	{ "",      NULL },    /* no layout function means floating behavior 无布局，即浮动*/
};

/* key definitions 按键定义 */
// #define MODKEY Mod1Mask /* 前缀键 Alt         */
#define MODKEY Mod4Mask    /* 前缀键 Win / Super */

#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
/* 以dwm-5.0之前的方式生成shell命令的助手 */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands  命令*/
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, \
                                               "-fn", dmenufont, \
                                               "-nb", col_gray1, \
                                               "-nf", col_gray3, \
                                               "-sb", col_cyan, \
                                               "-sf", col_gray4, \
                                               NULL };
static const char *termcmd[]  = { "st", NULL };

/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */
// static const StatusCmd statuscmds[] = {
// 	{ "notify-send Mouse1-$BUTTON", 1 },
// 	{ "notify-send Mouse2-$BUTTON", 2 },
// 	{ "notify-send Mouse3-$BUTTON", 3 },
// };
static const StatusCmd statuscmds[] = {
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 1 $BUTTON", 1 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 2 $BUTTON", 2 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 3 $BUTTON", 3 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 4 $BUTTON", 4 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 5 $BUTTON", 5 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 6 $BUTTON", 6 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 7 $BUTTON", 7 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 8 $BUTTON", 8 },
	{ "${HOME}/.dwm/scripts/dwm-statuscmd-cmds.sh 9 $BUTTON", 9 },
};
static const char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL };

static const Key keys[] = {
	/* modifier                     key        function        argument */
	/* 修改器                       按键        函数            参数     */
	/* 默认键位设置 */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },  /* 打开启动器 dmenu */
	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },  /* 打开终端 */
	{ MODKEY,                       XK_b,      togglebar,      {0} },  /* 开关状态栏 */
	{ MODKEY,                       XK_j,      focusstackvis,  {.i = +1 } },  /* 向下聚焦显示的窗口 */
	{ MODKEY,                       XK_k,      focusstackvis,  {.i = -1 } },  /* 向上聚焦显示的窗口 */
	{ MODKEY|ShiftMask,             XK_j,      focusstackhid,  {.i = +1 } },  /* 向下聚焦隐藏的窗口 */
	{ MODKEY|ShiftMask,             XK_k,      focusstackhid,  {.i = -1 } },  /* 向上聚焦隐藏的窗口 */
	// { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },  /* 主堆栈加1个应用位*/
	// { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },  /* 主堆栈减1个应用位 */
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },  /* 减少主堆栈窗口位置比*/
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },  /* 增加主堆栈窗口位置比 */
	// { MODKEY,                       XK_Return, zoom,           {0} },  /* 主次窗口空间换 */
	// { MODKEY,                       XK_Tab,    view,           {0} },  /* 切换最近应用 */
	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },  /* 关闭当前应用 */
	// { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },  /* 设置当前监视器窗口布局为 布局列表的第1个*/
	// { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },  /* 设置当前监视器窗口布局为 布局列表的第2个*/
	// { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },  /* 设置当前监视器窗口布局为 布局列表的第3个*/
	// { MODKEY,                       XK_space,  setlayout,      {0} },  /* 切回最近的布局 */
	// { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },  /* 开关窗口浮动 */
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },  /* 显示全部应用*/
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },  /* 显示全部tag*/
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },  /* */
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },  /* */
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },  /* */
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },  /* */
	{ MODKEY,                       XK_s,      show,           {0} },  /* 显示当前应用窗口 */
	{ MODKEY|ShiftMask,             XK_s,      showall,        {0} },  /* 显示所有应用窗口 */
	// { MODKEY,                       XK_h,      hide,           {0} },  /* 隐藏当前应用窗口 */
	TAGKEYS(                        XK_1,                      0)  /* 切换到0号tag */
	TAGKEYS(                        XK_2,                      1)  /* 切换到1号tag */
	TAGKEYS(                        XK_3,                      2)  /* 切换到2号tag */
	TAGKEYS(                        XK_4,                      3)  /* 切换到3号tag */
	TAGKEYS(                        XK_5,                      4)  /* 切换到4号tag */
	TAGKEYS(                        XK_6,                      5)  /* 切换到5号tag */
	TAGKEYS(                        XK_7,                      6)  /* 切换到6号tag */
	TAGKEYS(                        XK_8,                      7)  /* 切换到7号tag */
	TAGKEYS(                        XK_9,                      8)  /* 切换到8号tag */
	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },  /* 退出dwm */

	/* 补丁默认设置键位 */
	/* - layoutscroll 布局滚动 */
	// { MODKEY|ShiftMask,             XK_h,      layoutscroll,   {.i = -1 } },  /* 布局向上滚动 */
	// { MODKEY|ShiftMask,             XK_l,      layoutscroll,   {.i = +1 } },  /* 布局向下滚动 */
	/* - overview */
	{ MODKEY,                       XK_a,      toggleoverview, {0} }, /* 开启overview视图模式 */
    { MODKEY,                       XK_Tab,    overviewwinswitch,{.i = +1} }, /* 向下聚焦窗口 */
    { MODKEY|ShiftMask,             XK_Tab,    overviewwinswitch,{.i = -1} }, /* 向上聚焦窗口 */
	/* - focusurgent */
	// { MODKEY,                       XK_u,      focusurgent,    {0} },  /* 聚焦到紧急窗口 */
	/* - cfact */
	// { MODKEY|ShiftMask,             XK_h,      setcfact,       {.f = +0.25} }, /* 副窗口间大小比例调整 */
	// { MODKEY|ShiftMask,             XK_l,      setcfact,       {.f = -0.25} },
	// { MODKEY|ShiftMask,             XK_o,      setcfact,       {.f =  0.00} },
	/* - movestack */
	// { MODKEY|ShiftMask,             XK_j,      movestack,      {.i = +1 } }, /* 向下移动窗口堆栈 */
	// { MODKEY|ShiftMask,             XK_k,      movestack,      {.i = -1 } }, /* 向上移动窗口堆栈 */
	/* - vanitygaps */
	// { MODKEY|Mod4Mask,              XK_h,      incrgaps,       {.i = +1 } },
	// { MODKEY|Mod4Mask,              XK_l,      incrgaps,       {.i = -1 } },
	// { MODKEY|Mod4Mask|ShiftMask,    XK_h,      incrogaps,      {.i = +1 } },
	// { MODKEY|Mod4Mask|ShiftMask,    XK_l,      incrogaps,      {.i = -1 } },
	// { MODKEY|Mod4Mask|ControlMask,  XK_h,      incrigaps,      {.i = +1 } },
	// { MODKEY|Mod4Mask|ControlMask,  XK_l,      incrigaps,      {.i = -1 } },
	// { MODKEY|Mod4Mask,              XK_0,      togglegaps,     {0} },
	// { MODKEY|Mod4Mask|ShiftMask,    XK_0,      defaultgaps,    {0} },
	// { MODKEY,                       XK_y,      incrihgaps,     {.i = +1 } },
	// { MODKEY,                       XK_o,      incrihgaps,     {.i = -1 } },
	// { MODKEY|ControlMask,           XK_y,      incrivgaps,     {.i = +1 } },
	// { MODKEY|ControlMask,           XK_o,      incrivgaps,     {.i = -1 } },
	// { MODKEY|Mod4Mask,              XK_y,      incrohgaps,     {.i = +1 } },
	// { MODKEY|Mod4Mask,              XK_o,      incrohgaps,     {.i = -1 } },
	// { MODKEY|ShiftMask,             XK_y,      incrovgaps,     {.i = +1 } },
	// { MODKEY|ShiftMask,             XK_o,      incrovgaps,     {.i = -1 } },
	/* - moveplace */
	// q  w  e           NW  N  NE          西北  北  东北         左上  上  右上
	// a  s  d   <===>   W   C   E   <===>  西    中  东    <===>  左    中  右
	// z  x  c           SW  S  SE          西南  南  东南         左下  下  右下
	// { MODKEY,                       XK_q,      moveplace,      {.ui = WIN_NW }},
	// { MODKEY,                       XK_w,      moveplace,      {.ui = WIN_N  }},
	// { MODKEY,                       XK_e,      moveplace,      {.ui = WIN_NE }},
	// { MODKEY,                       XK_a,      moveplace,      {.ui = WIN_W  }},
	// { MODKEY,                       XK_s,      moveplace,      {.ui = WIN_C  }},
	// { MODKEY,                       XK_d,      moveplace,      {.ui = WIN_E  }},
	// { MODKEY,                       XK_z,      moveplace,      {.ui = WIN_SW }},
	// { MODKEY,                       XK_x,      moveplace,      {.ui = WIN_S  }},
	// { MODKEY,                       XK_c,      moveplace,      {.ui = WIN_SE }},
	// 7(Home)   8( ^ )  9(PgUp)           NW  N  NE          西北  北  东北         左上  上  右上
	// 4( <  )   5       6( >  )   <===>   W   C   E   <===>  西    中  东    <===>  左    中  右
	// 1(End )   2( v )  3(PgDn)           SW  S  SE          西南  南  东南         左下  下  右下
	{ MODKEY,                       XK_KP_Home,      moveplace,      {.ui = WIN_NW }},
	{ MODKEY,                       XK_KP_Up,        moveplace,      {.ui = WIN_N  }},
	{ MODKEY,                       XK_KP_Prior,     moveplace,      {.ui = WIN_NE }},
	{ MODKEY,                       XK_KP_Left,      moveplace,      {.ui = WIN_W  }},
	{ MODKEY,                       XK_KP_Begin,     moveplace,      {.ui = WIN_C  }},
	{ MODKEY,                       XK_KP_Right,     moveplace,      {.ui = WIN_E  }},
	{ MODKEY,                       XK_KP_End,       moveplace,      {.ui = WIN_SW }},
	{ MODKEY,                       XK_KP_Down,      moveplace,      {.ui = WIN_S  }},
	{ MODKEY,                       XK_KP_Next,      moveplace,      {.ui = WIN_SE }},
	/* - movethrow */
	{ MODKEY|ShiftMask,             XK_Up,     movethrow,      {.ui = DIR_N  }}, /* 窗口悬浮 居上 北 */
	{ MODKEY|ShiftMask,             XK_Down,   movethrow,      {.ui = DIR_S  }}, /* 窗口悬浮 居下 南 */
	{ MODKEY|ShiftMask,             XK_Left,   movethrow,      {.ui = DIR_W  }}, /* 窗口悬浮 居左 西 */
	{ MODKEY|ShiftMask,             XK_Right,  movethrow,      {.ui = DIR_E  }}, /* 窗口悬浮 居右 东 */
	{ MODKEY|ShiftMask,             XK_m,      movethrow,      {.ui = DIR_C  }}, /* 窗口悬浮 居中 */
	// { MODKEY|ControlMask,           XK_Up,     movethrow,      {.ui = DIR_U  }}, /* 窗口悬浮 居上半面 */
	// { MODKEY|ControlMask,           XK_Down,   movethrow,      {.ui = DIR_D  }}, /* 窗口悬浮 居下半面 */
	// { MODKEY|ControlMask,           XK_Left,   movethrow,      {.ui = DIR_L  }}, /* 窗口悬浮 居左半面 */
	// { MODKEY|ControlMask,           XK_Right,  movethrow,      {.ui = DIR_R  }}, /* 窗口悬浮 居右半面 */
	/* - tabmode */
	// { MODKEY,                       XK_w,      tabmode,        {-1} },
	/* - fullscreen */
	// { MODKEY|ShiftMask,             XK_f,      fullscreen,     {0} },  /* 真全屏 */ 
	/* actualfullscreen */
	// { MODKEY|ShiftMask,             XK_f,      togglefullscr,     {0} },  /* 真全屏 */ 
	/* - dynamicscratchpads */
	// { MODKEY,                       XK_minus,  scratchpad_show, {0} },  /* 从草稿栏恢复顺序窗口 */
	// { MODKEY|ShiftMask,             XK_minus,  scratchpad_hide, {0} },  /* 将所选窗口移动到草稿栏 */
	// { MODKEY,                       XK_equal,  scratchpad_remove,{0} }, /* 从草稿栏中删除所选窗口  */
	/* - rmaster */
	{ MODKEY,                       XK_r,      togglermaster,  {0} }, /* 切换主副区域位置 */
	/* - alwaysontop */
	// { MODKEY|ShiftMask,             XK_space,  togglealwaysontop, {0} }, /* 窗口总是在顶部 */
	/* keymodes */
	{ MODKEY,                       XK_Escape, setkeymode,     {.ui = COMMANDMODE} },

	/* 自定义设置键位 */
	// { MODKEY,                       XK_f,      showonlyorall,  {0} },   /* 显示一个或全部 */
	{ MODKEY,                       XK_f,      fullwinscreen,  {0} },   /* 开关当前假全屏 */
	{ MODKEY|ShiftMask,             XK_f,      togglefullscr,  {0} },   /* 开关当前真全屏 */
	{ MODKEY|ControlMask,           XK_f,      togglefloating, {0} },   /* 开关当前窗口浮动 */
	{ MODKEY,                       XK_Return, spawn,          SHCMD("wezterm") },  /* 打开终端 wezterm */
	{ MODKEY,                       XK_e,      spawn,          SHCMD("thunar") },   /* 打开文件管理器    */
	// { MODKEY|ShiftMask,             XK_Return, spawn,          SHCMD("st") },       /* 打开终端 st       */
	// { MODKEY|ShiftMask,             XK_Return, spawn,          SHCMD("kitty") },    /* 打开终端 kitty    */
	{ MODKEY,                       XK_space,  spawn,          SHCMD("~/.dwm/scripts/app-starter.sh rofi") },
	{ MODKEY|ShiftMask,             XK_Tab,    spawn,          SHCMD("~/.dwm/scripts/app-starter.sh rofi_window") }, /* */
	{ MODKEY|ControlMask,           XK_Tab,    layoutscroll,   {.i = +1 } },  /* 布局向下滚动 */
	{ MODKEY|ControlMask|ShiftMask, XK_Tab,    layoutscroll,   {.i = -1 } },  /* 布局向上滚动 */
	// { Mod1Mask,                     XK_space,  spawn,          SHCMD("utools") },
	{ MODKEY,                       XK_x,      spawn,          SHCMD("~/.dwm/scripts/app-starter.sh rofi_menu") },
	{ MODKEY,                       XK_k,      spawn,          SHCMD("~/.dwm/scripts/app-starter.sh blurlock") }, /* 锁屏*/
	// { MODKEY|ControlMask,           XK_l,      spawn,          SHCMD("~/.dwm/scripts/i3lock-get-screen-image-fancy") }, /* 锁屏 */
	// { MODKEY,                       XK_F1,     spawn,          SHCMD("~/.dwm/scripts/app-starter.sh filemanager") },
	// { MODKEY|ShiftMask,             XK_Up,     spawn,          SHCMD("~/.dwm/scripts/app-starter.sh set_vol up &") },
	// { MODKEY|ShiftMask,             XK_Down,   spawn,          SHCMD("~/.dwm/scripts/app-starter.sh set_vol down &") },
	{ MODKEY|ControlMask,           XK_j,      movestack,      {.i = +1 } }, /* 向下移动窗口堆栈 */
	{ MODKEY|ControlMask,           XK_k,      movestack,      {.i = -1 } }, /* 向上移动窗口堆栈 */
	{ MODKEY|ControlMask,           XK_h,      hide,           {0} }, /* 向上移动窗口堆栈 */

	{ MODKEY|ControlMask|ShiftMask, XK_j,      setcfact,       {.f = +0.25} }, /* 副窗口间大小比例调整 */
	{ MODKEY|ControlMask|ShiftMask, XK_k,      setcfact,       {.f = -0.25} }, /* 副窗口间大小比例调整 */
	{ MODKEY|ControlMask|ShiftMask, XK_l,      setmfact,       {.f = +0.25} }, /* 副窗口间大小比例调整 */
	{ MODKEY|ControlMask|ShiftMask, XK_h,      setmfact,       {.f = -0.25} }, /* 副窗口间大小比例调整 */

	// { MODKEY,                       XK_c,      moveplace,      {.ui = WIN_C  }}, /* 窗口悬浮 九宫格居中 */
	{ MODKEY,                       XK_m,      movethrow,      {.ui = DIR_M  }}, /* 窗口悬浮 居中 */
	{ MODKEY,                       XK_Up,     movethrow,      {.ui = DIR_U  }}, /* 窗口悬浮 居上半面 */
	{ MODKEY,                       XK_Down,   movethrow,      {.ui = DIR_D  }}, /* 窗口悬浮 居下半面 */
	{ MODKEY,                       XK_Left,   movethrow,      {.ui = DIR_L  }}, /* 窗口悬浮 居左半面 */
	{ MODKEY,                       XK_Right,  movethrow,      {.ui = DIR_R  }}, /* 窗口悬浮 居右半面 */

	{ MODKEY,                       XK_grave,  scratchpad_show,   {0} },  /* 从草稿栏恢复顺序窗口     */
	{ MODKEY|ShiftMask,             XK_grave,  scratchpad_hide,   {0} },  /* 将所选窗口移动到草稿栏   */
	{ MODKEY|ControlMask,           XK_grave,  scratchpad_remove, {0} },  /* 将所选窗口移动到草稿栏   */
	// { MODKEY,                       XK_equal,  scratchpad_hide,  {0} },  /* 将所选窗口移动到草稿栏   */
	// { MODKEY,                       XK_equal,  scratchpad_hide,  {0} },  /* 将所选窗口移动到草稿栏   */
	// { MODKEY,                       XK_minus,  scratchpad_remove,{0} }, /* 从草稿栏中删除所选窗口    */

	// { MODKEY|ShiftMask,             XK_Up,     movethrow,      {.ui = DIR_N  }}, /* 窗口悬浮 居上 北 */
	// { MODKEY|ShiftMask,             XK_Down,   movethrow,      {.ui = DIR_S  }}, /* 窗口悬浮 居下 南 */
	// { MODKEY|ShiftMask,             XK_Left,   movethrow,      {.ui = DIR_W  }}, /* 窗口悬浮 居左 西 */
	// { MODKEY|ShiftMask,             XK_Right,  movethrow,      {.ui = DIR_E  }}, /* 窗口悬浮 居右 东 */
	// { MODKEY|ShiftMask,             XK_m,      movethrow,      {.ui = DIR_C  }}, /* 窗口悬浮 居中 */
	// { MODKEY|ControlMask,           XK_Up,     movethrow,      {.ui = DIR_U  }}, /* 窗口悬浮 居上半面 */
	// { MODKEY|ControlMask,           XK_Down,   movethrow,      {.ui = DIR_D  }}, /* 窗口悬浮 居下半面 */
	// { MODKEY|ControlMask,           XK_Left,   movethrow,      {.ui = DIR_L  }}, /* 窗口悬浮 居左半面 */
	// { MODKEY|ControlMask,           XK_Right,  movethrow,      {.ui = DIR_R  }}, /* 窗口悬浮 居右半面 */

    /* 窗口间距更改 */
    { MODKEY|Mod1Mask,               XK_h,      incrgaps,       {.i = +1 } },
    { MODKEY|Mod1Mask,               XK_l,      incrgaps,       {.i = -1 } },
    { MODKEY|Mod1Mask|ShiftMask,     XK_h,      incrogaps,      {.i = +1 } },
    { MODKEY|Mod1Mask|ShiftMask,     XK_l,      incrogaps,      {.i = -1 } },
    { MODKEY|Mod1Mask|ControlMask,   XK_h,      incrigaps,      {.i = +1 } },
    { MODKEY|Mod1Mask|ControlMask,   XK_l,      incrigaps,      {.i = -1 } },
    { MODKEY|Mod1Mask,               XK_0,      togglegaps,     {0} },
    { MODKEY|Mod1Mask|ShiftMask,     XK_0,      defaultgaps,    {0} },

    { MODKEY|ControlMask|ShiftMask,  XK_t,      togglealwaysontop, {0} }, /* 窗口总是在顶部 */
};

static Key cmdkeys[] = {
	/* modifier                    keys                     function         argument */
	{ 0,                           XK_Escape,               clearcmd,        {0} },
	{ ControlMask,                 XK_c,                    clearcmd,        {0} },
	{ 0,                           XK_i,                    setkeymode,      {.ui = INSERTMODE} },
};

static Command commands[] = {
	/* modifier (4 keys)                          keysyms (4 keys)                                function         argument */
	// { {ControlMask, ShiftMask,  0,         0},    {XK_w,      XK_h,     0,         0},            setlayout,       {.v = &layouts[0]} },
	// { {ControlMask, 0,          0,         0},    {XK_w,      XK_o,     0,         0},            setlayout,       {.v = &layouts[2]} },
	{ {ControlMask, ShiftMask,  0,         0},    {XK_w,      XK_o,     0,         0},            onlyclient,      {0} },
	{ {ControlMask, 0,          0,         0},    {XK_w,      XK_v,     0,         0},            setlayout,       {.v = &layouts[0]} },
	{ {ControlMask, 0,          0,         0},    {XK_w,      XK_less,  0,         0},            setmfact,        {.f = -0.05} },
	{ {ControlMask, ShiftMask,  0,         0},    {XK_w,      XK_less,  0,         0},            setmfact,        {.f = +0.05} },
	{ {ControlMask, ShiftMask,  0,         0},    {XK_w,      XK_0,     0,         0},            setmfact,        {.f = +1.50} },
	{ {ShiftMask,   0,          0,         0},    {XK_period, XK_e,     0,         0},            spawn,           {.v = dmenucmd} },
	{ {ShiftMask,   0,          0,         0},    {XK_period, XK_o,     0,         0},            spawn,           {.v = dmenucmd} },
	// { {ShiftMask,   0,          0,         0},    {XK_period, XK_h,     XK_Return, 0},            spawn,           {.v = helpcmd} },
	{ {ShiftMask,   0,          0,         0},    {XK_period, XK_q,     XK_Return, 0},            quit,            {0} },
	{ {ShiftMask,   0,          0,         0},    {XK_period, XK_b,     XK_d,      XK_Return},    killclient,      {0} },
	{ {ShiftMask,   0,          0,         0},    {XK_period, XK_b,     XK_n,      XK_Return},    focusstackwrapper,      {.i = +1} },
	{ {ShiftMask,   0,          ShiftMask, 0},    {XK_period, XK_b,     XK_n,      XK_Return},    focusstackwrapper,      {.i = -1} },
};

/*
* 
* XK_grave      `键
* XK_equal      加号/等号键 
* XK_minus      减号键
* XK_semicolon  分号
* XK_comma      逗号键
* XK_period     句号键
* 
*/

/* button definitions 按钮定义*/
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
/* click中定义： 
    ClkLtSymbol    窗口布局标记
    ClkStatusText  点击状态栏
    ClkWinTitle    点击窗口标题
    ClkTagBar      点击标记栏
    ClkClientWin   点击客户窗口

   button中定义含义： 
    Button1  代表鼠标左键； 
    Button2  代表鼠标中键； 
    Button3  代表鼠标右键； 
*/
static const Button buttons[] = {
	/* click                event mask      button          function                      argument */
	/* 点击                 事件掩码         按键            函数                           参数    */
	// /* 默认设置 */
	{ ClkTagBar,            0,              Button1,        view,                           {0} }, /* 聚焦切换tag 单*/
	{ ClkTagBar,            0,              Button3,        toggleview,                     {0} }, /* tag加入当前监视器 */
	{ ClkTagBar,            MODKEY,         Button1,        tag,                            {0} }, /* 开关切换tag */
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,                      {0} }, /* 开关tag */
	// { ClkWinTitle,          0,              Button1,        togglewin,                      {0} }, /* 开关应用窗口 */
	// { ClkWinTitle,          0,              Button2,        zoom,                           {0} }, /* 主次窗口空间换 */
	// { ClkStatusText,        0,              Button3,        spawn,                          {.v = termcmd } }, /* 打开终端 */
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,                      {0} }, /* 鼠标拖拽移动窗口位置 */
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating,                 {0} }, /* 开关窗口浮动 */
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,                    {0} }, /* 鼠标拖拽移动窗口尺寸 */
	// /* 补丁默认设置 */
	// { ClkButton,            0,              Button1,        spawn,                          {.v = dmenucmd } }, /* 打开终端 */
	/* - statuscmd */
	{ ClkStatusText,        0,              Button1,        spawn,                          {.v = statuscmd } },
	{ ClkStatusText,        0,              Button2,        spawn,                          {.v = statuscmd } },
	{ ClkStatusText,        0,              Button3,        spawn,                          {.v = statuscmd } },
	/* - overview */
	{ ClkLtSymbol,          0,              Button2,        toggleoverview,                 {0} }, /* 开启/关闭overview视图模式 */
    { ClkOverview,          0,              Button1,        toggleoverview,                 {0} },    /* 开启/关闭overview视图模式 */
    { ClkOverviewSymbol,    0,              Button1,        toggleoverview,                 {0} },    /* 开启/关闭overview视图模式 */
    { ClkOverviewWinTitleButton, 0,         Button1,        clickfocusandkillclient,        {0} },    /* 开启/关闭overview视图模式 */
    { ClkOverviewWinTitle,  0,              Button1,        overviewwintileclickswitch,     {0} },    /* overview视图模式下，选中窗口标题 返回*/
	/* - tabmode */
	// { ClkTabBarWinTitle,    0,              Button1,        focuswin,                       {0} },
	{ ClkTabBarWinTitle,    0,              Button2,        focuswin,                       {0} },

	// /* 自定义点击设置 */
	{ ClkLtSymbol,          0,              Button1,        layoutscroll,                   {.i = +1 } },  /* 布局向下滚动 */
	{ ClkLtSymbol,          0,              Button3,        layoutscroll,                   {.i = -1 } },  /* 布局向上滚动 */
	{ ClkButton,            0,              Button1,        spawn,                          SHCMD("~/.dwm/scripts/app-starter.sh rofi")},
	{ ClkButton,            0,              Button2,        toggleshowalltags,              {0} },    /* 是否显示所有tag标签 */
	{ ClkButton,            0,              Button3,        spawn,                          SHCMD("~/.dwm/scripts/app-starter.sh rofi_menu") },
	{ ClkWinTitleButton,    0,              Button1,        clickfocusandkillclient,        {0} },    /* 点击聚焦然后关闭 */
	{ ClkWinTitleButton,    0,              Button2,        clicktogglealwaysontop,         {0} },    /* 点击聚焦开关浮动 总是居上 */
	{ ClkWinTitleButton,    0,              Button3,        clicktogglewinorresizemouse,    {0} },    /* 聚焦并鼠标拖拽改变窗口尺寸 */
	{ ClkWinTitle,          0,              Button1,        clicktogglewinormousemove,      {0} },    /* 显示或移动窗口 */
	{ ClkWinTitle,          0,              Button2,        clicktogglefloating,            {0} },    /* 点击聚焦开关浮动 */
	{ ClkWinTitle,          0,              Button3,        clickshowonlyorall,             {0} },    /* 显示或隐藏当前窗口 */
    { ClkClientWin,         MODKEY|ControlMask, Button1,    dragmfact,                      {0} },    /* 鼠标拖拽调整主副窗口尺寸大小 */
    { ClkClientWin,         MODKEY|ControlMask, Button3,    dragcfact,                      {0} },    /* 鼠标拖拽调整副窗口之间尺寸大小 */
    { ClkClientWin,         MODKEY,         Button1,        moveorplace,                    {0} },    /* 鼠标拖拽移动窗口位置 */
    { ClkClientWin,         MODKEY,         Button2,        togglefloating,                 {0} },    /* 开关选中窗口浮动 */
    { ClkClientWin,         MODKEY,         Button3,        resizemouse,                    {0} },    /* 鼠标拖拽调整窗口尺寸大小 */

	// { ClkStatusText,        0,              Button2,        spawn,                          SHCMD("~/.dwm/scripts/app-starter.sh rofi_window") },
	// { ClkStatusText,        0,              Button1,        toggletabmode,                  {0} }, /* 切换tabmode */

	// { ClkTabBarWinTitle,    0,              Button1,        focuswin,                       {0} },
	// { ClkTabBarWinTitle,    0,              Button2,        clicktogglefloating,            {0} },
	// { ClkTabBarWinTitle,    0,              Button3,        clickshowonlyorall,             {0} },
	// { ClkTabWinTitleButton, 0,              Button1,        clickfocusandkillclient,        {0} }, /* 关闭选中窗口 */
	// { ClkTabWinTitleButton, 0,              Button2,        clicktogglefloating,            {0} },
	// { ClkTabWinTitleButton, 0,              Button3,        clickshowonlyorall,             {0} },

	{ ClkTabBarWinTitle,    0,              Button1,        focuswin,                       {0} },
	{ ClkTabBarWinTitle,    0,              Button2,        clicktabmodetogglefloating,     {0} },
	{ ClkTabBarWinTitle,    0,              Button3,        focuswin,                       {0} },

	{ ClkTabWinTitleButton, 0,              Button1,        clicktabmodefocusandkillclient, {0} }, /* 关闭选中窗口 */
	{ ClkTabWinTitleButton, 0,              Button2,        clicktabmodetogglealwaysontop,  {0} }, /* 窗口浮动在顶层 */
	{ ClkTabWinTitleButton, 0,              Button3,        focuswin,                       {0} }, /* 窗口浮动在顶层 */

	{ ClkTabPrev,           0,              Button1,        movestack,      				{.i = -1 } }, /* 关闭选中窗口 */
	{ ClkTabNext,           0,              Button1,        movestack,                      {.i = +1 } }, /* 窗口浮动在顶层 */
	{ ClkTabClose,          0,              Button1,        killclient,                     {0} }, /* 窗口浮动在顶层 */
	{ ClkKeyMode,           0,              Button1,        togglekeymode,                  {0} }, /* 按键模式转换 */

};

/* signal definitions  外部信号对应表 */
/* signum must be greater than 0 */
/* trigger signals using `xsetroot -name "fsignal:<signum>"` */
static Signal signals[] = {
	/* signum       function        argument  */
	// { 1,            setlayout,      {.v = 0} },
	{ 1,            quit,           {0} },
	// { 1,            layoutscroll,           {.i = +1} },
	{ 2,            layoutscroll,   {.i = +1 } },
};

/* include(s) depending on the configuration variables */
#include "keymodes.post.h"